package cn.kgc.service.impl;


import cn.kgc.mapper.ProMapper;
import cn.kgc.pojo.SmbmsProvider;
import cn.kgc.service.ProService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("proService")
public class ProServiceimpl implements ProService {

    @Resource
    ProMapper proMapper;

    @Override
    public int getProConut(String proName) {
        return proMapper.getProConut(proName);
    }

    @Override
    public List<SmbmsProvider> getProByPage(Integer currentPageNo, Integer pageSize, String proName) {
        Integer pageNo = (currentPageNo-1)*pageSize;
        return proMapper.getProByPage(pageNo,pageSize,proName);
    }

    @Override
    public boolean addPro(SmbmsProvider smbmsProvider) {
        int conut = proMapper.addPro(smbmsProvider);
        if (conut>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public boolean updatePro(SmbmsProvider smbmsProvider) {
        int conut = proMapper.updatePro(smbmsProvider);
        if (conut>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public boolean delProId(Integer id) {
        int conut = proMapper.delProId(id);
        if (conut>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public SmbmsProvider getProId(Integer id) {
        return proMapper.getProId(id);
    }

    @Override
    public SmbmsProvider getProCode(String proCode) {
        return proMapper.getProCode(proCode);
    }
}
